package com.yesjpt.serv.impl;

import com.alibaba.fastjson.JSONObject;
import com.yesjpt.serv.BaseServ;
import com.yesjpt.util.ContextUtil;
import com.yesjpt.util.L;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class BaseServImpl implements BaseServ {

    @Value("#{@environment['websocket.base'] ?: null }")
    protected String websocketBase;

    @Override
    public JSONObject getConfig() {
        JSONObject o = new JSONObject();
        o.put("websocketBase", websocketBase.replace("//", "/").replace("s:", "s:/"));
        o.put("sessionId", ContextUtil.getSession().getId());
        L.i(new Throwable().getStackTrace()[0] + ", conf = " + o);
        return o;
    }
}














